package com.visualize.demo.repository;

import com.visualize.demo.model.Place;
import com.visualize.demo.model.RefreshRate;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

import java.util.Date;
import java.util.List;

public interface RefreshRateRepository extends CrudRepository<RefreshRate, Integer> {
    @Query(value =
            "select id,time,date_time,percent from refresh_rate " +
                    "where time between :start_time and :end_time", nativeQuery = true)
    List<RefreshRate> getRefreshRateByTime(@Param("start_time") Date start_time, @Param("end_time") Date end_time);
}
